package formvalidate

import "github.com/gookit/validate"

// PassagersForm passagers 表单
type PassagersForm struct {
	Id          int    `form:"id"`
	Avatar      string `form:"avatar"`
	Authorname    string `form:"authorname" validate:"required"`
	Nickname    string `form:"nickname" validate:"required"`
	Title    string `form:"title" validate:"required"`
	Status      int8   `form:"status"`
	Description string `form:"description"`
	CreateTime  int    `form:"create_time"`
	UpdateTime  int    `form:"update_time"`
	DeleteTime  int    `form:"delete_time"`
	IsCreate    int    `form:"_create"`
}

// Messages 自定义验证返回消息
func (f PassagersForm) Messages() map[string]string {
	return validate.MS{
		"Avatar.required":    "作者作者头像不能为空.",
		"Authorname.required":    "作者名称不能为空.",
		"Nickname.required":    "作者昵称不能为空.",
		"Title.required":      "文章标题不能为空.",
		"Description.required":    "文章内容不能为空.",
	}

}
